package com.mz.ieann.aide.city.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * <p>------------------------------------------------------
 * <p> Copyright (C) 2021 zhangmz, All rights reserved.
 * <p> If there is technical discussion, you can contact zhangmz90@foxmail.com
 * <p>------------------------------------------------------
 * <p> des
 * <p>
 *
 * @author Created by Administrator
 * @date on 2021 2021/10/24 17:13
 */
public class City implements Parcelable {

    private String id;
    private String name;
    private String letter;
    private String firstLetter;
    private boolean first;
    private List<City> data;

    public City(){

    }

    public City(String name, String firstLetter){
        this.name = name;
        this.firstLetter = firstLetter;
    }

    protected City(Parcel parcel) {
        id = parcel.readString();
        name = parcel.readString();
        letter = parcel.readString();
        firstLetter = parcel.readString();
        first = parcel.readByte() != 0;
        data = parcel.createTypedArrayList(City.CREATOR);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(name);
        dest.writeString(letter);
        dest.writeString(firstLetter);
        dest.writeByte((byte) (first ? 1 : 0));
        dest.writeTypedList(data);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<City> CREATOR = new Creator<City>() {
        @Override
        public City createFromParcel(Parcel in) {
            return new City(in);
        }

        @Override
        public City[] newArray(int size) {
            return new City[size];
        }
    };

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLetter() {
        return letter;
    }

    public void setLetter(String letter) {
        this.letter = letter;
    }

    public String getFirstLetter() {
        return firstLetter;
    }

    public void setFirstLetter(String firstLetter) {
        this.firstLetter = firstLetter;
    }

    public boolean isFirst() {
        return first;
    }

    public void setFirst(boolean first) {
        this.first = first;
    }

    public List<City> getData() {
        return data;
    }

    public void setData(List<City> data) {
        this.data = data;
    }
}
